﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Bll;
using DAL;
using SimpComm;
using ViewModel;

namespace Ui.Controllers
{
    public class CompanyController : Controller
    {
        //
        // GET: /ControlSharep/

        public ActionResult Index(int ID = 0)
        {
            if (ID == 0) return RedirectToAction("Index", "Home");
            Func<Comp, CompDetailInfoModel> select = p =>
            {
                return new CompDetailInfoModel()
                {
                    Name = p.Name,
                    Type = p.Type,
                    Comp_Info = p.Comp_Info ?? new Comp_Info(),
                    Comp_Compsite = p.Comp_Compsite ?? new Comp_Compsite(),
                };
            };
            var comp = CompService.Instance.GetAModel(p => p.ID == ID, select);
            return View(new MS<DataInfo<CompDetailInfoModel>>(comp));
        }

        public ActionResult WriteReview()
        {
            return View();
        }

        public ActionResult CommentDetail()
        {
            return View();
        }

        public ActionResult CompanyInfo()
        {
            return View();
        }
        public ActionResult CompanyComment()
        {
            return View();
        }
    }
}
